<template>
  <DatePicker
    allow-clear
    :value-format="format"
    :format="format"
    v-bind="$attrs"
    style="width: 100%"
  />
</template>

<script setup lang="tsx">
import { DatePicker } from 'ant-design-vue';
import { computed, useAttrs } from 'vue';

const attrs: any = useAttrs();
const format = computed(() => {
  return attrs.showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
});
</script>
